chore(mypy): fix type hints for inline provider files#5399
Open
Elbehery wants to merge 2 commits intollamastack:mainfrom
Open
chore(mypy): fix type hints for inline provider files#5399Elbehery wants to merge 2 commits intollamastack:mainfrom
Elbehery wants to merge 2 commits intollamastack:mainfrom
Conversation
7a3ad27 to
1281090
Compare
ed6fa50 to
3d6839b
Compare
leseb
requested changes
Apr 2, 2026
3d6839b to
0d80df5
Compare
Contributor
Author
ptal |
Fix mypy strict type checking errors in inline provider files: - Add type annotations for jobs/benchmarks dictionaries - Fix variable shadowing (benchmark → benchmark_json) - Add sampling_params type annotation (dict[str, Any]) - Separate completion and chat variable scopes - Add proper union types for messages list - Add assertions for non-streaming responses and non-None content - Add config attribute declaration (Any type) - Change model_store from ModelStore to ModelStore | None - Import OpenAIChatCompletionWithReasoning types - Add correct return type for openai_chat_completions_with_reasoning - Import OpenAIChatCompletionWithReasoning types - Add correct return type for openai_chat_completions_with_reasoning pyproject.toml: - Add sentence_transformers to mypy ignore_missing_imports (no type stubs) Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
Revert chat_params/completion_params back to params and chat_response/completion_response back to response. These renames were not fixing anything and added noise to the diff. Keep all the actual type hints and assertions that add value. Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
0d80df5 to
6fca531
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fix mypy strict type checking errors in inline provider files:
Fixed SentenceTransformerEmbeddingMixin.model_store type to match InferenceProvider protocol (ModelStore | None instead of ModelStore)
Fixed eval.py type errors:
cc @leseb